package com.qhu.home.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qhu.home.model.MonitorInfo;
import com.qhu.home.service.ServiceFactory;

@Controller
public class MaintanenceController {
	
	 @RequestMapping(value = "info", method = RequestMethod.GET)
	 public @ResponseBody MonitorInfo getCpuLoad() {
		 MonitorInfo ret = null;
	    try {
	    	ret = ServiceFactory.getMonitorService().getInformation();
		} catch (Exception e) {
			ret = new MonitorInfo();
			e.printStackTrace();
		}
		return ret;
	  }  
	 
	 @RequestMapping(value = "maintanence", method = RequestMethod.GET)  
	 public String show() {  

	    return "maintanence";
	  } 
}
